<?php
include 'dbconfig.php'; 
mysql_select_db($db, $con);

$year = $_POST['year'];
$key = $_POST['key'];
$term = $_POST['term'];
$teacher = $_POST['teacher'];
$id = $_POST['id'];

$query2 = "UPDATE course_instances SET year = $year, term = $term, coursekey = '$key', teacher = '$teacher' WHERE id = $id LIMIT 1";

echo $query2;

mysql_query($query2);

mysql_close($con);

?>